import {defineStore} from "pinia";

export const useUserStore = defineStore('user', {
    state: () => {
        return {
            id: null,
            nickname: '',
            username: ''
        }
    },
    getters: {
    },
    actions: {
        getUserInfo() {
            return this
        },
        setUserInfo(data) {
            this.id = data.id;
            this.nickname = data.nickname;
            this.username = data.username;
            this.avatar = data.avatar;
            this.email = data.email;
            this.phone = data.phone;
            this.sex = data.sex;
        },
    }
})

